
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    var obj={color:"yellow"};
    function Tiger(){
        this.color="yellow";
        this.leg=4;
        this.act="猛虎下山";
    }
    Tiger.prototype=function(){
        console.log(this.leg);
    };
//    Tiger.prototype=obj;
//    Tiger.prototype.weight=270;
//    Tiger.prototype.hobbby="爬山";
    var hobby="爬山";
//       console.log( Tiger.prototype.hobby);
    Tiger.prototype.hobby=hobby;
    var wast=new Tiger();
    console.log(wast);
</script>
</body>
</html>